package com.fengze.shop.common.listener;

import java.util.HashMap;
import java.util.Map;

/**
 * 用户在线状态
 */
public class UserOnlineState {

    private static final Map<String, Integer> state = new HashMap<String, Integer>();

    public static String getLoginID(String loginType, String loginName) {
        return loginType + "#" + loginName;
    }

    public static Map<String, Integer> getState() {
        return state;
    }

    public static boolean isLogin(String loginType, String loginName){
        String loginID = getLoginID(loginType,loginName);
        return state.containsKey(loginID);
    }
}
